import axios from 'axios';

const req = axios.create({
    timeout: "30000",
    baseURL: '',
    withCredentials: true
})
req.interceptors.response.use(config => {
        if (config.data) {
            return config.data
        }
    }, (err) => {

        return err
    })
    // req.interceptors.request.use(config => {
    //     return config
    // }, err => {})
req.defaults.withCredentials = true;
// axios.defaults.withCredentials = true 前端跨域传递Cookie设置;
export default req